/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BCategory2;
import BLL.BProduct;
import java.util.ArrayList;

/**
 *
 * @author Vien-IT
 */
public class Category3 {
    private int category3Id;
    private String name;
    private int category2Id;
    private Category2 category2;
    private ArrayList<Product> products;

    /**
     * @return the category3Id
     */
    public int getCategory3Id() {
        return category3Id;
    }

    /**
     * @param category3Id the category3Id to set
     */
    public void setCategory3Id(int category3Id) {
        this.category3Id = category3Id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the category2Id
     */
    public int getCategory2Id() {
        return category2Id;
    }

    /**
     * @param category2Id the category2Id to set
     */
    public void setCategory2Id(int category2Id) {
        this.category2Id = category2Id;
    }

    /**
     * @return the category2
     */
    public Category2 getCategory2() {
        if(category2 == null)
        {
            category2 = new BCategory2().getById(category2Id);
        }
        return category2;
    }

   

    /**
     * @return the products
     */
    public ArrayList<Product> getProducts() {
        if(products == null)
        {
            products = new BProduct().getByCategory3Id(category3Id);
        }
        return products;
    }

   
}
